home *** CD-ROM | disk | FTP | other *** search
- /*
- * DETUtilities.h
- * Copyright © 1992 Apple Computer Inc. All Rights Reserved.
- *
- * This is a collection of utility functions that simplify
- * programming OCE Directory Templates (DSAM) files. They
- * provide access to template properties and a few other
- * common bits of information.
- */
- #ifndef __DETUtilities__
- #define __DETUtilities__
-
- #include <OCETemplates.h>
- #if TRUE != 1
- #define TRUE 1
- #define FALSE 0
- #endif
-
- /*
- * Add an item to the template menu.
- * property ??
- * parameter ??
- * text Menu text
- * isSeparator TRUE if adding a ---- mark
- */
- pascal OSErr AddToMenu(
- DETCallBlockPtr callBlockPtr,
- short property,
- short parameter,
- RString *text,
- Boolean isSeparator
- );
-
- /*
- * Add/change an item to the template property database.
- * property The property to add
- * newValue A pointer to the datum
- * newValueSize The size of the datum
- * markAsChanged Mark database "changed"
- * This function does the actual database manipulation.
- * Normally, programs call SetBinaryProperty, SetNumProperty,
- * or SetRStringProperty to set particular data types.
- */
- pascal OSErr SetPropertyCommon(
- DETCallBlockPtr callBlockPtr,
- DETCallFunctions function,
- short property,
- void *newValue,
- Size newValueSize,
- Boolean markAsChanged
- );
-
- /*
- * Add/change a numeric property.
- * See SetPropertyCommon for the common parameters.
- * newValue The property value.
- */
- pascal OSErr SetNumProperty(
- DETCallBlockPtr callBlockPtr,
- short property,
- long newValue,
- Boolean markAsChanged
- );
-
- /*
- * Add/change a binary (untyped) property.
- * See SetPropertyCommon for the common parameters.
- * newValue -> the new datum
- * newValueSize Datum size
- */
- pascal OSErr SetBinaryProperty(
- DETCallBlockPtr callBlockPtr,
- short property,
- Ptr newValue,
- Size newValueSize,
- Boolean markAsChanged
- );
-
- /*
- * Add/change a RString property.
- * See SetPropertyCommon for the common parameters.
- * newValue The new string contents
- */
- pascal OSErr SetRStringProperty(
- DETCallBlockPtr callBlockPtr,
- short property,
- RString *newValue,
- Boolean markAsChanged
- );
-
- /*
- * Return the value of a numeric property
- * result Address of the desired value
- */
- pascal OSErr GetNumProperty(
- DETCallBlockPtr callBlockPtr,
- short property,
- long *result
- );
-
- /*
- * Return the value of an untyped property
- * result Gets a handle to the desired value
- */
- pascal OSErr GetBinaryProperty(
- DETCallBlockPtr callBlockPtr,
- short property,
- Handle *result
- );
-
- pascal OSErr GetBinaryPropertySize(
- DETCallBlockPtr callBlockPtr,
- short property,
- Size *size
- );
-
- /*
- * Return the value of a RString property
- * result Gets a pointer to the RString value
- */
- pascal OSErr GetRStringProperty(
- DETCallBlockPtr callBlockPtr,
- short property,
- RString ***result
- );
-
- /*
- * Mark property "dirty"
- */
- pascal OSErr DirtyProperty(
- DETCallBlockPtr callBlockPtr,
- short property
- );
-
- /*
- * Mark property "changed" if the flag is TRUE.
- */
- pascal OSErr SetPropertyChanged(
- DETCallBlockPtr callBlockPtr,
- short property,
- Boolean isPropertyChanged
- );
-
- /*
- * Return a pointer to the DSSSpec for this template
- */
- pascal OSErr GetMyDSSpec(
- DETCallBlockPtr callBlockPtr,
- short *refNum,
- PackedDSSpec ***pDsSpec
- );
-
- /*
- * Get the number of items selected by the user.
- */
- pascal OSErr GetNumSelectedItems(
- DETCallBlockPtr callBlockPtr,
- long *result
- );
-
- /*
- * GetNthSelectedItem allows the program to iterate
- * through the items selected by a user.
- */
- pascal OSErr GetNthSelectedItem(
- DETCallBlockPtr callBlockPtr,
- long itemNumber,
- PackedDSSpec ***pDsSpec,
- short *refNum
- );
-
- pascal OSErr OpenDSSpec(
- DETCallBlockPtr callBlockPtr,
- PackedDSSpec *dsSpec
- );
-
- pascal OSErr GetMyFSSpec(
- DETCallBlockPtr callBlockPtr,
- FSSpec *fsSpecPtr
- );
-
- pascal OSErr GetMenuItemRString(
- DETCallBlockPtr callBlockPtr,
- short property,
- long parameter,
- RString ***result
- );
-
- pascal OSErr RequestSync(
- DETCallBlockPtr callBlockPtr
- );
-
- pascal OSErr SaveProperty(
- DETCallBlockPtr callBlockPtr,
- long property
- );
-
- pascal OSErr GetCustomViewBounds(
- DETCallBlockPtr callBlockPtr,
- short property,
- Rect *bounds
- );
-
- pascal OSErr GetPropertyEditable(
- DETCallBlockPtr callBlockPtr,
- short property,
- Boolean *isEditable
- );
-
- pascal OSErr SetPropertyEditable(
- DETCallBlockPtr callBlockPtr,
- short property,
- Boolean isEditable
- );
-
- #endif /* __DETUtilities__ */
-